 package com.smc.sys.utils;

import com.smc.common.utils.SpringContextHolder;
import com.smc.configuration.SysConfig;

public class SysUtils {

     public static Boolean isOnline(){
         Boolean flag = false;
         String env = getEnv();
         if(env!=null ){
             if(env.startsWith("pro") || env.startsWith("pre")){
                 flag = true;
             }
         }
         return flag;
     }
     public static String getEnv(){
         String env = "";
         //String env = Global.getConfig("system.run.env");
         SysConfig sysConfig = SpringContextHolder.getBean(SysConfig.class);
         if(sysConfig!=null){
             env = sysConfig.getEnv();
         }
         return env;
     }
     
     public static String getCheckPermissions(){
         String str = "";
         SysConfig sysConfig = SpringContextHolder.getBean(SysConfig.class);
         if(sysConfig!=null){
             str = sysConfig.getCheckPermissions();
         }
         return str;
     }
     
     public static String getTaskOpen(){
         String str = "";
         SysConfig sysConfig = SpringContextHolder.getBean(SysConfig.class);
         if(sysConfig!=null){
             str = sysConfig.getTaskOpen();
         }
         return str;
     }
     public static String getLoginSrc(){
         String str = "";
         SysConfig sysConfig = SpringContextHolder.getBean(SysConfig.class);
         if(sysConfig!=null){
             str = sysConfig.getLoginSrc();
         }
         return str;
     }

}
